
import { ref } from 'vue';
import { defineStore } from 'pinia';
import EsAjax from '@/utils/EsAjax';
import ApiUrls from '@/apis/index';

/**
 * 
 */
export default defineStore('building', () => {
  // 权限代码数据
  const bildingList = ref([]);
  function getBuildList() {
    EsAjax.post(ApiUrls.buildingAll, {}).then(res => {
      bildingList.value = res.data.data || [];
    }).catch(err => {
      ElMessage.error(err.message);
    })
  }

  return {
    bildingList,
    getBuildList
  }
}) 